{extend name='table'}

{block name="content"}
<style type="text/css">
    .layui-tab-card>.layui-tab-title .layui-this {
        background-color: #009988
    }
</style>
<div class="layui-tab layui-tab-card">
    <ul class="layui-tab-title">
        {foreach $typeList as $k=>$v}
        {if isset($type) and $type eq $k}
        <li data-open="{:url('index')}?type={$k}" class="layui-this">{$v}</li>
        {else}
        <li data-open="{:url('index')}?type={$k}">{$v}</li>
        {/if}
        {/foreach}
    </ul>
    <div class="layui-tab-content">
        <table id="DataAddTable" data-url="{:sysuri('index')}" data-target-search="form.form-search"></table>
    </div>
</div>

<script>
    $(function () {
        $('#DataAddTable').layTable({
            even: true, height: 'full',
            sort: {field: 'o.id desc', type: 'desc'},
            where: {type: '{$type|default="3"}'},
            cols: [[
                {field: 'ordersn', title: '{:lang("订单编号")}', minWidth: 100, align: 'center', templet: '<div>{{d.ordersn||"-"}}</div>'},
                {field: 'nickname', title: '{:lang("会员")}', minWidth: 100, align: 'center', templet: '<div>{{d.nickname||"-"}}</div>'},
                {field: 'address', title: '{:lang("收货信息")}', minWidth: 100, align: 'center', templet:'<div>{{d.address.realname||"-"}}<br>{{d.address.mobile||"-"}}<br>{{d.address.province||"-"}}{{d.address.city||"-"}}{{d.address.area||"-"}}{{d.address.address||"-"}}</div>'},
                {field: 'mptime', title: '{:lang("最后支付时间")}', align: 'center', minWidth: 100,templet:'<div>{{d.mptime||"-"}}</div>'},
                {field: 'status', title: '{:lang("状态")}', align: 'center', minWidth: 80},
            ]]
        });
    });
</script>
{/block}